﻿using System;

class NXSum
{
    static void Main()
    {
        int n = 20;
        decimal nFactorial = 1;
        int x = 8;
        decimal xPow = 1;
        decimal sum = 1;
        for (int i = 1; i <= n; i++, xPow *= x)
        {
            for (int k = i; k > 1; k--)
            {
                nFactorial *= i;
            }
            sum += (nFactorial / xPow);
            nFactorial = 1;
        }
        Console.WriteLine("S = 1 + 1!/X + 2!/X² + ... + N!/X^N = {0:F2}", sum);
    }
}
